package com.MedDroid.entities.database;

import com.MedDroid.entities.Cryptography;

/**
 * Created with IntelliJ IDEA.
 * User: Romen
 * Date: 28/11/13
 * Time: 2:02 PM
 * Description: Represents a single field in the database, contains a label to be found by name, and a string value.
 */
public class DatabaseField
{
	String Name;
	String Value;

	public DatabaseField(String Name, String Value)
	{
		this.Name = Name;
		this.Value = Value;
	}

	public String getValue()
	{
		return Value;
	}

	public void setValue(String Value)
	{
		this.Value = Value;
	}

	public String getName()
	{
		return Name;
	}

	public void encrypt()
	{
		Name = Cryptography.encrypt(Name);
		Value = Cryptography.encrypt(Value);
	}

	public void decrypt()
	{
		Name = Cryptography.decrypt(Name);
		Value = Cryptography.decrypt(Value);
	}
}
